{% extends "front/base.html" %}

{% block title %}动植物数据库系统{% endblock %}

{% block head %}
  <link rel="stylesheet" href="{{ url_for('static',filename='front/css/index.css') }}">

  <!-- 嵌入CSS来设置背景图片 -->
  <style>
    body {
      background-image: url('{{ url_for('static', filename='common/images/2056853.jpg') }}');
      background-size: cover; /* 让背景图片覆盖整个页面 */
      background-position: center; /* 让背景图片居中 */
      background-repeat: no-repeat; /* 防止背景图片重复 */
    }

    /* 您可以根据需要添加其他样式 */
    .content1-container {
      /* 假设您有一个容器来包裹表单内容，以防止背景图片影响表单的可读性 */
      background-color: rgba(255, 255, 255, 80); /* 半透明白色背景 */
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      width: 70%;
      margin-right: 0 auto;
      margin-left: 0;
      float:left;
      padding-top: 20px;
      overflow: hidden;
    }
  </style>
{% endblock %}

{% block body %}
  <div class="content1-container">
    <div class="post-group">
      <ul class="post-list-group">
        {% for post in posts %}
          <li>
          <div class="post-info-group">
            <p class="post-title">
              <a href="{{ url_for('front.post_detail_plant',plant_id=post.id) }}">{{ post.name }}</a>
            </p>
            <p class="post-info">
              <span><b>作者：</b>{{ post.author_id }}</span> # 改
              <span>发表时间：{{ post.create_time }}</span>
              <span>阅读数：{{ post.read_count }}</span>
            </p>
          </div>
        </li>
        {% endfor %}
      </ul>
      {{ pagination.links }}
    </div>
  </div>
  <div class="sm-container">
    <div style="padding-bottom:10px;">
      <a href="{{ url_for('front.public_post') }}" class="btn btn-warning btn-block">发布你的看法</a>
    </div>
    <div class="list-group">
      {% if current_board %}
        <a href="/" class="list-group-item">全部分类</a>
      {% else %}
        <a href="/" class="list-group-item active">全部分类</a>
      {% endif %}
      {% for board in boards %}
        {% if board.id == current_board %}
          <a href="{{ url_for('front.index_plant',board_id=board.id) }}" class="list-group-item active">{{ board.name }}</a>
        {% else %}
          <a href="{{ url_for('front.index_plant',board_id=board.id) }}" class="list-group-item">{{ board.name }}</a>
        {% endif %}
      {% endfor %}
    </div>
  </div>
{% endblock %}